#!/bin/bash
#替换源
sed -i s@/deb.debian.org/@/mirrors.aliyun.com/@g /etc/apt/sources.list
#　安装依赖
apt-get update 
apt-get install -y curl wget git make build-essential zlib1g-dev libbz2-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev openssl libsqlite3-dev libxml2 libxml2-dev libxslt1-dev liblzma-dev
# 安装nvm
curl -L -o nvm-install.sh https://gitee.com/batcom/scripts/raw/master/nvm-install.sh && bash nvm-install.sh
source ~/.bashrc
source ~/.bashrc

#　配置nvm 安装镜像
echo "export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node">>~/.bashrc
source ~/.bashrc

#　安装最近版node
nvm install node
# 配置npm node镜像
echo 'sass_binary_site=https://npm.taobao.org/mirrors/node-sass/
phantomjs_cdnurl=https://npm.taobao.org/mirrors/phantomjs/
electron_mirror=https://npm.taobao.org/mirrors/electron/
registry=https://registry.npm.taobao.org/
disturl=https://npm.taobao.org/dist'>>~/.npmrc

#　安装whistle
npm install whistle -g
